#ifndef ENTITY_H
#define ENTITY_H

#include <QObject>
#include <QHash>
#include <QVariant>
#include <QMetaProperty>
#include <QStringList>

class Entity: public QObject
{
    Q_OBJECT
    Q_PROPERTY(QObject* parent READ parent WRITE setParent SCRIPTABLE false)
    Q_PROPERTY(qulonglong mId READ mId WRITE setmId NOTIFY mIdChanged)

public:
    explicit Entity(QObject *parent = 0);

    qulonglong mId();
    void setmId(qulonglong mId);

    QHash<QString, QVariant> data(QStringList fields = QStringList());

    QString keys(QString sep=",");

    QString values(QString sep, QString delim, QStringList fields = QStringList());
    QString values();

    QString keysValues(QString sep, QString delim);
    QString keysValues();

    void setParent(QObject *p);
    QObject* parent();

protected:
    qulonglong m_mId;

signals:
    void mIdChanged();

public slots:

};

#endif // ENTITY_H
